package com.gonsin.gmessage.logic.model;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

@Data
public class GMessageResponseResult<T> {

    @ApiModelProperty(value = "返回码", example = "200")
    private Integer state = 200;//响应状态码

    @ApiModelProperty("响应信息")
    private String message;//响应信息

    @ApiModelProperty("相应数据")
    private T data;//响应数据

    public static <D> GMessageResponseResult<D> result(D data) {
        GMessageResponseResult responseResult = new GMessageResponseResult();
        responseResult.state = 200;
        responseResult.message = "";
        responseResult.setData(data);
        return responseResult;
    }

}
